﻿using log4net;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using Timesheet.Data.Infrastructure;
using Timesheet.Data.Repository;
using Timesheet.Domain;

namespace Timesheet.Service
{
    public class ClassCodesService : IClassCodesService
    {
        private readonly IClassCodeRepository _Repository;
        private readonly IUnitOfWork _UnitOfWork;
        public ILog Logger { get; private set; }

        public ClassCodesService(IClassCodeRepository ClassCodeRepository,IUnitOfWork unitOfWork)
        {
            this._Repository = ClassCodeRepository;
            this._UnitOfWork = unitOfWork;
        }


        #region IClassCodesService Members


        public ClassCode GetByID(long id)
        {
            return _Repository.GetById(id);
        }

        public void Add(ClassCode entity)
        {
           _Repository.Add(entity);
        }

        public void Update(ClassCode entity)
        {
           _Repository.Update(entity);
        }

        public void Delete(ClassCode entity)
        {
            _Repository.Delete(entity);
        }
        
        public IList<ClassCode> GetClassCodes()
        {
            return _Repository.GetAll().OrderBy(p=>p.Name).ToList();
        }
       
        #endregion


        #region IClassCodesService Members



        #endregion
    }
}
